 
 
 import utils from '../utils/index'
 const user = {
    state:()=>({
        logined:false,
        loginedUser:{},
        token:utils.localStorage.get('token') || ''
    }),
    mutations:{
        login(state,payload){
            state.logined = true
            let user = payload.user
            state.token = user.token
            state.loginedUser.username = user.username
            state.loginedUser.roleName = user.roleName
        },
        loginOut(state){
            state.logined = false
            state.token = ''
            state.loginedUser = {}
        }
    },
    actions:{

    },
    getters:{

    }
}

export default user